<template>
    <div>
        <!-- 父子传参 -->
        <h1>父组件</h1>
        <bbb :user="user" ></bbb>
        <p  @messageSent="handleMessage">
            {{ info.name }}
            {{info.age}}
        </p>
    </div>
</template>
<script setup >
// 父子传参
import {reactive, ref} from 'vue'
import bbb from "@/views/bbb/index.vue"
const user=ref({
    name:'张三',
    age:18
})
defineEmits({
   users:{
    type:Function
   }
})
const info=reactive({
    name:'',
    age:null
})
const handleMessage=(name,age)=>{
    info.name=name
    info.age=age

}

</script>
